package binarytree;

import java.util.LinkedList;
import java.util.List;
import java.util.Queue;

public class Test {

    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        System.out.println(binaryTree.isCompleteTree(root));
    }
    public static void main1(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
        System.out.println();
        List<Integer> list=binaryTree.preorderTraversal(root);
        System.out.println(list);
        int sum=binaryTree.size2(root);
        System.out.println("节点的个数："+sum);
        binaryTree.size(root);
        System.out.println("节点的个数："+BinaryTree.nodeSize);
        //int sum1=binaryTree.getLeafNodeCount1(root);
       // System.out.println("叶子节点的个数："+sum1);
        binaryTree.getLeafNodeCount1(root);
        System.out.println("叶子节点的个数："+BinaryTree.leafSize);
       int sum2= binaryTree.getLeafNodeCount2(root);
        System.out.println("叶子节点的个数："+sum2);
        System.out.println("第k层节点的个数："+binaryTree.getKLevelNodeCount(4, root));
        System.out.println("二叉树的高度："+binaryTree.getHeight(root));
        System.out.println("find::"+binaryTree.find(root, 3).val);
        System.out.println("层序遍历结果为：");
        binaryTree.levelOrder(root);
        System.out.println();
        List<List<Integer>> ret=binaryTree.levelOrder2(root);
        System.out.println(ret);
    }
}
